<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>复杂JSON字符串</title>
    <script type="text/javascript" src="../../../jquery.js"></script>
    <script type="text/javascript" src="../../../ui/om-core.js"></script>
    <script type="text/javascript" src="../../../ui/om-suggestion.js"></script>
    <link rel="stylesheet" type="text/css" href="../../../themes/default/om-all.css" />
    <link rel="stylesheet" type="text/css" href="../../common/css/demo.css" />
    <style>
    .itemFloatLeft {
        float: left
    }
    
    .itemFloatRight {
        float: right;
        color: #AAAAAA;
    }
    </style>
    <!-- view_source_begin -->
    <script type="text/javascript">
        $(document).ready(function() {
            $('#txt').omSuggestion({
                dataSource : '../../../advancedSuggestion.json',
                clientFormatter : function(data,index){
                    return '<div class="itemFloatLeft">' + data.text 
                        + '</div><div class="itemFloatRight">约<font color="red">' 
                        + data.count + '</font>条记录</div>';
                }
            });
        });
    </script>
    <!-- view_source_end -->
</head>
<body>
    <!-- view_source_begin -->
    <input id="txt" style="width:250px"/>
    <!-- view_source_end -->
    <div id="view-desc">
        设置clientFormatter属性，dataSource返回的数据被格式化显示。
    </div>
    <script type="text/javascript" src="../../common/js/themeloader.js"></script>
</body>
</html>